<template>
	<!-- 禁止滑动  @touchmove.stop.prevent-->
	<view class="nodata" v-if="show" @touchmove.stop.prevent>
		<image :src="emptyImage?emptyImage:baseImg" mode="widthFix" class="empty_image"></image>
		<text :style="{color:textColor}">{{ text }}</text>
	</view>
</template>

<script>
	export default {
		props: {
			text: {
				type: String,
				default: '暂无数据'
			},
			textColor: {
				type: String,
				default: '#333'
			},
			emptyImage: {
				type: String,
			},
			show: {
				type: Boolean,
				default: false //是否显示图片
			}
		},
		data() {
			return {
				baseImg: ''
			};
		},
	};
</script>

<style lang="scss">
	.nodata {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		color: #666;
		font-size: 0.9rem;
		overflow-y: hidden;
		position: absolute;
		margin: auto;
		right: 0;
		left: 0;
		bottom: 0;
		top: 0;
	}
	.empty_image {
		width: 200rpx !important;
	}
</style>
